package com.cameron.vod.utils;


import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 阿里云 视频点播服务配置信息
 * @author cameron
 */
@Component
public class OssConstants implements InitializingBean {
    //读取配置文件内容

    @Value("${aliyun.vod.file.address}")
    private String address;

    /**
     * 获取键
     */
    @Value("${aliyun.vod.file.keyid}")
    private String keyId;

    /**
     * 获取密钥
     */
    @Value("${aliyun.vod.file.keysecret}")
    private String keySecret;

    /**
     * 获取阿里云中bucket的名称
     */
    @Value("${aliyun.vod.file.region}")
    private String region;

    public static String ADDRESS;
    public static String KEY_ID;
    public static String KEY_SECRET;
    public static String REGION;

    /**
     * 在上述private属性成功注入后执行的方法
     */
    @Override
    public void afterPropertiesSet() throws Exception {
        REGION = region;
        KEY_ID = keyId;
        KEY_SECRET = keySecret;
        ADDRESS = address;
    }
}
